package com.ytjj.qmyx.admin.service;

import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.model.CategoryNow;
import com.ytjj.qmyx.admin.model.request.CategoryNowRequest;
import com.ytjj.qmyx.admin.model.request.ProductCategoryRequest;
import com.ytjj.qmyx.admin.model.response.CategoryNowResponse;
import com.ytjj.qmyx.admin.model.response.ProductCategoryResp;
import com.ytjj.qmyx.admin.model.response.ProductCategoryResponse;
import com.ytjj.qmyx.mall.model.ProductCategory;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

public interface ProductCategoryService {

    CommonPage<ProductCategoryResponse> list(ProductCategoryRequest productCategoryRequest);

    int create(ProductCategory productCategory);

    int createV2(ProductCategory productCategory);

    int update(ProductCategory productCategory);

    int updateV2(ProductCategory productCategory);

    int delete(Integer id);

    ProductCategory getProductCategory(Integer id);

    CategoryNow getCategoryNow(Integer id);


    CommonPage<ProductCategoryResponse> getParentList(ProductCategoryRequest pcRequest);

    CommonPage<CategoryNowResponse> getParentListV2(ProductCategoryRequest pcRequest);

    List<ProductCategory> getFirstList();

    List<ProductCategory> getSecondList(Integer id);

    List<ProductCategory> getChildrens();

    CommonPage<ProductCategoryResponse> getChildrensById(ProductCategoryRequest pcRequest);

    CommonPage<CategoryNowResponse> getChildrensByIdV2(ProductCategoryRequest pcRequest);

    List<Map<String,Object>> getSpecListByCategoryId(Integer categoryId);

    /**
     * @Description 新增三级分类
     *
     *
     *
     * @Version 1.0
     **/
    void addBottomCategory(ProductCategoryRequest productCategoryRequest);

    /**
     * 获取三级分类列表
     *
     * 
     * @return
     */
    CommonPage<ProductCategoryResponse>  getBottomCategoryList(@RequestBody ProductCategoryRequest productCategoryRequest);

    /**
     * 获取三级分类列表
     *
     *
     * @return
     */
    CommonPage<CategoryNowResponse>  getBottomCategoryListV2(@RequestBody ProductCategoryRequest productCategoryRequest);

    /**
     * @Description 编辑三级分类信息
     *
     *
     *
     * @Version 1.0
     **/
    void editBottomCategory(Integer id, String title, Byte status);

    /**
     * @Description 删除三级分类
     *
     *
     *
     * @Version 1.0
     **/
    void deleteBottomCategory(Integer id);


    List<ProductCategoryResp> showAllCategory();

    /**
     * 分类集合进行排序
     * @param categoryList
     * @return
     */
    List<ProductCategoryResp> getProductCategoryResps(List<ProductCategoryResp> categoryList);
}
